package com.example.luke.cashorderingsystem.Model;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Created by luke on 17/11/2016.
 */

public class CardRecord {
    String ticketID;//发票号
    String CardNo;//卡号

    int UsageCount=0;//次数

    int PurchaseAmount=0;//消费额

    int Remain=0;// 余额

    String DiscountRate="100%";//折扣比

    String cardName;//会员姓名

    String usageDate;//日期时间

    String DeviceNo="1";//机器号

    String Operator="0";//操作员
    int refundIndex=0;

    int payMode;//0 现金,1 信用卡,2 签单,3 会员卡,4 礼劵, 8 - 退货  会员卡,9 - 退货  现金

    int ReportType=1;//1:充值,2:取款,3:退款,7:随机消费/定额消费,6:商品消费

    public String getTicketID() {

        return ticketID;
    }

    public String getCardNo() {
        return CardNo;
    }

    public int getUsageCount() {
        return UsageCount;
    }

    public int getPurchaseAmount() {
        return PurchaseAmount;
    }

    public int getRemain() {
        return Remain;
    }

    public String getDiscountRate() {
        return DiscountRate;
    }

    public String getUsageDate() {

        if (usageDate==null){
            usageDate=getDate();

        }
//
        return usageDate;
    }

    public int getRefundIndex() {
        return refundIndex;
    }

    public String getDeviceNo() {
        return DeviceNo;
    }

    public String getOperator() {
        return Operator;
    }

    public int getReportType() {
        return ReportType;
    }

    public void setUsageCount(int usageCount) {
        UsageCount = usageCount;
    }

    public String getCardName() {
        return cardName;
    }

    public  CardRecord(String cardNo){
        CardNo=cardNo;

    }

    public void setCardName(String cardName) {
        this.cardName = cardName;
    }

    public void setTicketID(String ticketID) {
        this.ticketID = ticketID;
    }

    public void setReportType(int reportType) {
        ReportType = reportType;
    }

    public String getDate() {
        DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.getDefault());
        Date date = new Date();
        return dateFormat.format(date);

    }

    public void setRefundIndex(int refundIndex) {
        this.refundIndex = refundIndex;
    }


    public void setPayMode(int payMode) {
        this.payMode = payMode;
    }

    public int getPayMode() {
        return payMode;
    }

    public void setPurchaseAmount(int purchaseAmount) {
        PurchaseAmount = purchaseAmount;
    }

    public void setRemain(int remain) {
        Remain = remain;
    }


}
